package model;

/**
 * Account.java
 * Purpose: Represents an account.
 * 
 * @author Elzard Boer
 * @version 0.1 10/01/2012
 */

public class Account {
	/* Identifies the account */
	private long id;
	/* User name */
	private String userName;
	/* Password */
	private String password;
	/* Does the account have administrative rights */
	private boolean admin;
	
	/** Constructs a new account */
	public Account() {
	}
	
	/** Constructs a new account */
	public Account(String userName) {
		this.userName = userName;
	}
	
	/** Constructs a new account */
	public Account(String userName, String password) {
		this.userName = userName;
		this.password = password;
	}

	/** Returns the id of the account */
	public long getId (){
		return this.id;
	}
	
	/** Sets the id of the Account */
	public void setId(long id){
		this.id = id;
	}
	
	/** Returns the user name of the account */
	public String getUserName (){
		return this.userName;
	}
	
	/** Sets the user name of the account */
	public void setUserName (String userName){
		this.userName = userName;
	}
	
	/** Returns the password of the account */
	public String getPassword(){
		return this.password;
	}
	
	/** Sets the password of the account */
	public void setPassword(String password){
		this.password = password;
	}

	/** Returns the admin state of the account */
	public boolean getAdmin(){
		return this.admin;
	}
	
	/** Sets the admin state of the account */
	public void setAdmin(Boolean admin){
		this.admin = admin;
	}
	
	/** Returns a string representation of the account */
	@Override
	public String toString() {
		return String.format("%s", this.userName);
	}
}